package messaage;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

public class CreateThreadMsg extends Message {

	protected String forumID;
	protected String topicName;
	protected String body;
	protected String username;

	public CreateThreadMsg(String _username, String _forumID,
			String _topicName, String _body) {
		this.username = _username;
		this.forumID = _forumID;
		this.body = _body;
		this.topicName = _topicName;
		this.type = "CreateThreadMsg";
	}

	@Override
	public String toString() {
		XStream xstream = new XStream(new DomDriver());
		String xml = xstream.toXML(this)+"\0";

		return xml;
	}

	public int getForumID() {
		return Integer.parseInt(this.forumID);
	}

	public String getTopicName() {
		return topicName;
	}

	public String getBody() {
		return body;
	}

	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}

}
